import requests
import pymysql
import json
host = 'http://192.168.50.149:4010'

def post_tingshou_data(data):
    r = requests.post(host + '/api/v1/kachezhijia/xingxi', data=data)
    return(r.text)

file_path = '/home/ubuntu/workspace/pbs_old/canshu.csv'
with open(file_path) as f:
    list_canshu = f.readlines()

for canshu in list_canshu:
    # canshu_json = json.loads(canshu.replace("\'", "\""))
    canshu = canshu.replace("\'", "\"")
    data = {'canshu': canshu}
    # print(type(canshu_json), canshu_json)
    post_tingshou_data(data)
    print(data)
    # 执行sql语句
